Skip to content

fix(SV): standards-correct BER and metadata-enabled VLAN 0/PCP 4 Quick Start interoperability - #357

Merged
masarray merged 6 commits into
mainfrom
fix/sv-wire-metadata-iec-asdu-interop
Nov 4, 2026
Merged

masarray merged 6 commits into
mainfrom
fix/sv-wire-metadata-iec-asdu-interop

Conversation

@masarray

@masarray masarray commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

Direct independent ESP32-P4 PCAP evidence

Operator's 2026-11-04 capture: 140,116 SV frames in 35.03s (3999.91fps), 0 missing/duplicate/out-of-order counters, 0 malformed. Every frame is VLAN priority-tagged (VID=0 PCP=4), APPID 0x4000, svID ARSTACK_SV01, 64B 4I+4V instMag/q; the ASDU has no 0x81 dataSet/0x86 smpRate/0x88 smpMod while 0x89 GM identity is present and smpSynch=2 without external traceability. Optional absence is not in itself an IEC violation, but generic Analyzer lacks the reference without SCL.

Actual production fixes

  • Canonical IEC61850 SV BER: smpCnt fixed 2 bytes, confRev 4, smpSynch 1, sampleRate 2, sampleMode 2; still prebuilt before the 4 kHz runtime packet-loop.
  • Actual Studio Quick Start loads new arstack_4i4v_9-2le_metadata_lab.scd which matches the user's physical VLAN0 PCP4 and sends optional dataSet + sampleRate/SmpPerSec=4000. It runs through the existing SCL parser/compiler, immutable profile and firmware controlled deploy/readback. Original arstack_4i4v_9-2le_reference.scd is preserved strictly minimal for legacy interop. Separately opt-in untagged lab fixture also enables metadata for untagged networks.
  • No unsupported GM identity [9] appended despite SCL synchSourceId=false. Internal bench GM can at most claim local sync1 after measured phase/MAC; never global sync2 without independently measured global traceability; otherwise 0. Existing explicit lab override remains clearly simulated.
  • Independent PCAP audit reports optional-field presence and strict --require-metadata / --require-unsynchronized opt-in; rejects malformed field sizes/duplicate tags, does not fabricate missing fields.
  • C++ canonical BER golden vectors updated; immutable old PCAP fixture intentionally remains a negative exact-reencode regression, while canonical newly encoded frame passes exact equivalence. Retains genuine malformed-frame fail-closed behavior.
  • Engineer instructions and positive/negative SCL test guard old minimum and new metadata.

Acceptance boundaries

No automatic flashing, STOP or START. Updated SCL is applied only after operator STOP + SCL re-import + deploy/readback + START. Encoding/sync firmware change requires revision-qualified firmware update under existing supervisor STOPPED proof. CI + standalone mocked fixtures do not establish physical relay acceptance. Use PR #3 masarray/SVGen raw analyzer (new preview CI) rather than obsolete screenshot Mode: Live / Synthetic locked timebase. Avoid overlapping firmware lifecycle PR #355 and M4 lane.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T01:48:33.028131Z
We couldn’t complete this review. Comment @codex review to try again.
7fac75b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@masarray masarray changed the title fix(sv): standards-correct metadata, ASDU widths and fail-safe smpSynch for analyzer interoperability fix(SV): standards-correct BER and metadata-enabled VLAN 0/PCP 4 Quick Start interoperability Nov 4, 2026
@masarray
masarray merged commit b7871b8 into main Nov 4, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant